//
//  record_login.m
//  SoundPill
//
//  Created by 宋旭东 on 15/5/5.
//  Copyright (c) 2015年 宋旭东. All rights reserved.
//

#import "record_login.h"
#import "AppDelegate.h"
@implementation record_login
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UILabel *loginlabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.frame.size.height / 2 - 100, self.frame.size.width, 50)];
        loginlabel.text = @"还没有登陆哦";
        loginlabel.textAlignment = NSTextAlignmentCenter;

        [self addSubview:loginlabel];
        UIButton *loginbutton = [UIButton buttonWithType:UIButtonTypeCustom];
        loginbutton.frame = CGRectMake(self.frame.size.width / 2 - 50, self.frame.size.height / 2 - 25, 100, 50);
        [loginbutton setTitle:@"请登录" forState: UIControlStateNormal];
        [loginbutton addTarget:self action:@selector(GoToLogin:) forControlEvents:UIControlEventTouchUpInside];
        loginbutton.layer.cornerRadius = 5;
        loginbutton.backgroundColor = [UIColor colorWithRed:0.169f green:0.584f blue:0.984f alpha:1.00f];
        [self addSubview:loginbutton];
    }
    return self;
}
- (void)GoToLogin:(UIButton *)sender
{
//    CATransition *transition = [CATransition animation];
//    transition.duration = 0.8f;
//    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
//    transition.type = kCATransitionPush;
//    transition.subtype = kCATransitionFromBottom;
//    transition.delegate = self;
//    [self.superview.layer addAnimation:transition forKey:nil];
//    [self removeFromSuperview];
    [[AppDelegate shareDelegate] chooseRootViewController];

}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
